import type { App } from "vue";
import { createPinia } from "pinia";
import piniaPluginPersistedstate from 'pinia-plugin-persistedstate';

const store = createPinia();
store.use(piniaPluginPersistedstate); // ✅ 注册持久化插件

// 全局注册 store
export function setupStore(app: App<Element>) {
  app.use(store);
}

// 导出模块化 store
export * from "./modules/user";
export * from "./modules/dict";
export * from "./modules/theme";
export * from "./modules/cards";

export { store };
